package com.liukunup.testcase;

import com.liukunup.judge.impl.JudgeEditDistance;
import lombok.extern.slf4j.Slf4j;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

/**
 * 冒烟测试
 * @author Liu Kun
 * @date 2021-04-03 20:26:05
 **/
@Slf4j
public class TsSmoke {

    @DataProvider(name = "editDistanceDataProvider", parallel = true)
    public Object[][] editDistanceDataProvider() {
        return new Object[][] {
                // 相同
                { "abc", "abc" },
                // 替换
                { "abc", "adc" },
                // 删除
                { "abcde", "abde" },
                // 插入
                { "abde", "abcde" },
                // 综合情况
                { "abcdef", "axceyf" },
                // 异常情况
                { "", "" },
                { "", "abc" },
                { "abc", "" },
                { null, null },
                { null, "abc" },
                { "abc", null },
        };
    }

    @Test(dataProvider = "editDistanceDataProvider", groups = {"smoke"}, description = "编辑距离测试")
    public void testEditDistance(String src, String dst) {
        JudgeEditDistance judge = new JudgeEditDistance();
        judge.doJudge(dst, src, String.class);
    }
}
